a = eval(input())
print(oct(a))
print(hex(a))